diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-10-18 19:25:02 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-11 18:14:41 +0100 |
| commit | 94448fa278ab352a741ff13f22d6104869571144 (patch) | |
| tree | 2185e77f2866d11a0144d4ac5a01c71a76807341 /src/pages/projets/[slug].tsx | |
| parent | c153f93dc8691a71dc76aad3dd618298da9d238a (diff) | |
feat(components): add a generic Grid component
* merge Columns, Gallery and CardsList into Grid component
* add more options to control the grid
Diffstat (limited to 'src/pages/projets/[slug].tsx')
| -rw-r--r-- | src/pages/projets/[slug].tsx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/pages/projets/[slug].tsx b/src/pages/projets/[slug].tsx index 3d3c57e..17be961 100644 --- a/src/pages/projets/[slug].tsx +++ b/src/pages/projets/[slug].tsx @@ -6,11 +6,10 @@ import Head from 'next/head'; import NextImage, { type ImageProps as NextImageProps } from 'next/image'; import { useRouter } from 'next/router'; import Script from 'next/script'; -import type { ComponentType, HTMLAttributes } from 'react'; +import type { ComponentType, HTMLAttributes, ReactNode } from 'react'; import { useIntl } from 'react-intl'; import { Code, - Gallery, getLayout, Link, Overview, @@ -25,6 +24,7 @@ import { type MetaItemData, type MetaValues, Time, + Grid, } from '../../components'; import styles from '../../styles/pages/project.module.scss'; import type { NextPageWithLayout, ProjectPreview, Repos } from '../../types'; @@ -120,6 +120,16 @@ const UnorderedList = ({ </List> ); +const Gallery = ({ children }: { children: ReactNode[] }) => ( + <Grid + gap="sm" + items={children.map((child, index) => { + return { id: `${index}`, item: child }; + })} + sizeMin="250px" + /> +); + const components: MDXComponents = { Code, Gallery, |
